home *** CD-ROM | disk | FTP | other *** search
- PAGE 56,80
- @FILENAME EQU <ASWIT.COM>
- COMMENT |
- *****************************************************************************
- Date: 21/01/98 - 10/10/98.
- Last Edit: 10/10/98.
- File Name: ASWIT120.ASM.
- Description: ACESOFT SUBLIMATE WRITING INTO TEXT.
- Version: 1.20 FOURTH MAJOR VERSION.
- Purpose: A command line text file ASC2 normaliser.
- OutputFormat: Initially as a .COM file.
- Watch this space for a WINDOWS version.
- Comments: Decided to develop this to automate HTML text extraction.
-
- It's a funny old world - but on playing with the Internet
- some more..................
-
- Objectives:
- Open file for input if extant else quit.
- Open file for output if not *.asw format else quit.
- Check if input file *.html, or *.hst set flag if it is.
- Get bytes using a subroutine with a eof dropout to close all.
-
- HTML:
- Look for " on same line:
- does it contain HTTP/http \ or / (it must have no spaces):
- if so write line with " deliniators till repeat of " or '<CR>'.
- *N.B. Can't use ' type deliniator!!!!!!!!!
-
- HST/WBS:
- Look for HTTP/http and x:\........
- write line with " deliniators till character equal or below 0Dh.
- lines are assumed to terminate on 0 (NUL) or >=80h characters.
-
- Any Other:
-
- File must be pre-read to find out whether strings of 0Ah exist in odd or
- even numbers etc.:
- Lone 0Dhs must each be converted to 0D0Ah characters.
- Lone 0Ahs must each be converted to 0D0Ah characters.
- Paired 0Ahs (0A0Ahs) must be converted to 0D0Ah characters.
- 0D0Ah characters must be ignored.
- Lone 0Dhs = NULType 1 (bit 0).
- Lone 0Ahs = NULType 2 (bit 1).
- Paired 0Ahs (0A0Ahs) = NULType 128 (bit 7)
- 0D0Ah = NULType 0 (NUL).
- All four represent distinct types of ASC2 text file and have to be treated
- accordingly.
-
- Replace single #0s or #0 strings with a single rtn ***** IMPROVED FROM 1.1.
- ALSO CHR 01AH == EOF must be changed for space characters **** NOT DONE 1.1.
- Replace 0Ah type returns with full 0Dh,0Ah ones.
- Else copy character.
-
-
- ShareWare Version:
- The ShareWare Version of ASWIT will have a file length restriction
- built into it to encourage registration.
-
- Additions for v1.10:
- 1). 'FAT.DB' should be reccognised as a '*.HST' type file.
- .........................................Done.
-
- 2). The 'HTML' processing routine should have a more intelligent way of
- handling strings with spaces.
- .........................................Done.
-
- 3). The 'HTML' processing routine should also contain a search for '.htm'
- and '.HTM' throughout any likely strings, in the same way as 'HTML'......
- ..........................................JPG/GIF also done.
-
- 4). A string such as 'HnHTTP://..........' can fool the 'HST' handler.
- ...........................................Now searches all string.
-
- 5). Though the kernal routine is useful as a compact assembly COM file a
- Windows loader in a high level language (VB) would make it more user friendly.
- .........................................See Visual Basic loader.
-
- 6). Stop command line accepting strings of spaces as file names.
- .........................................Done.
-
- Additions for v1.20:
-
- 1). ASCII processor should replace #0 strings with a single rtn.
- .........................................Improved.
-
- 2). ASCII processor should replace any #01Ah (text eof chr) with a #020h (spc).
- .........................................Done.
-
- 3). The 'HTML' processing routine should also contain a search for '.pl',
- '.ra', '.mov', '.exe', '.com', '.cgi', '.arj', 'jpe', 'jfi' and '.zip'.
- .........................................
-
- *****************************************************************************
-
- Error Returns:
-
- 0). Use: ASWIT [PATH]FILENAME.TYPE<Return>.
- 1). Name/path too long i.e. <= 63+8+4==75-4 (for an extra file type if needed).
- 2). Bad file name given.
- 3). Illegal file type.
- 4). Sorry I won't operate on an ASW file, they're my children.
- 5). Error opening input file.
- 6). Error opening output file.
- 7). Error reading input file.
- 8). Error writing output file.
- 9). Error closing input file.
- 10). Error closing output file.
- 11). Job done, no errors.
- 12). Bad program environment.
- 13). Must use DOS 3 or higher.
-
- *****************************************************************************
- |
- MASM
- .MODEL TINY, NOLANGUAGE ;;ASSEMBLER WINDOWS
- .8086
- ;; .386
- .SEQ
- ;; .STACK 100h
- %CREF
-
- ;; .DATA
- .CONST
- TRUE = 1
- FALSE = 0
- NUL = 0
- ;
- DTest = 0 ;;1=Test of unscrambled ASWIT.COM file.
- ATest = 0 ;;1=Test of NUL File type.
- ShareWare = 1 ;;1=ShareWare, 0=Registered.
- ;
- SWLimit = 25 ;;i.e. 24*255 bytes = 6k, plus one
- HTML = 1 ;;HTML input file type.
- HST = 2 ;;HST input file type.
- ASW = 4 ;;ASW input file type.
-
- StartAswit PROC NOWINDOWS ;;WINDOWS
- .CODE
- ORG 100h
- AswitCode: ;;************************************************************
-